package patrol.mobile.com.mobilepatrol.activity.security.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.dl7.recycler.adapter.BaseQuickAdapter;
import com.dl7.recycler.adapter.BaseViewHolder;

import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.activity.security.emergency.EmergencyEnsure2Activity;
import patrol.mobile.com.mobilepatrol.activity.security.emergency.EmergencyEnsureMade2Activity;
import patrol.mobile.com.mobilepatrol.bean.Ensure1Bean;
import patrol.mobile.com.mobilepatrol.bean.EnsureMade1Bean;

/**
 * Created by K on 2018/9/11.
 * des:
 */
public class EmergencyEnsureMade1ListAdapter extends BaseQuickAdapter<EnsureMade1Bean> {
    public EmergencyEnsureMade1ListAdapter(Context context) {
        super(context);
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.item_emergency_ensure_made_1_list;
    }

    @Override
    protected void convert(BaseViewHolder holder, final EnsureMade1Bean item) {
        holder.setText(R.id.tv_num, (holder.getLayoutPosition() + 1) + "");
        holder.setText(R.id.tv_mechanismName, item.getMechanismName());
        holder.setText(R.id.tv_mechanismLevel, item.getMechanismLevel());
        holder.setText(R.id.tv_mechanismDate, item.getMechanismDate());

        holder.setOnClickListener(R.id.rl_root, new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(mContext, EmergencyEnsureMade2Activity.class);
                intent.putExtra("id", item.getId());
                mContext.startActivity(intent);
            }
        });
    }
}
